﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Collections;
using System.Windows.Input;
using RIDA.Globals;
using System.Diagnostics;
using RIDA.Stub;

namespace RIDA.TaskView.ViewModel
{
    public class TasksToolboxViewModel : ViewModelBase
    {
        public TasksToolboxViewModel()
        {

        }

        private ObservableCollection<TaskCategoryViewModel> _categories;
        public ObservableCollection<TaskCategoryViewModel> Categories
        {
            get
            {
                if (_categories == null)
                {
                    _categories = new ObservableCollection<TaskCategoryViewModel>();
                    var alltasks = new TasksRepositoryStub().ReadTasks();
                    var fs = new TaskCategoryViewModel() { Name = "File System" };
                    var iis = new TaskCategoryViewModel() { Name = "IIS" };
                    foreach (var item in alltasks)
                    {
                        fs.Tasks.Add(new TaskToolboxViewModel() { Task = item });
                        iis.Tasks.Add(new TaskToolboxViewModel() { Task = item });
                    }
                    _categories.Add(fs);
                    _categories.Add(iis);
                }
                return _categories;
            }
        }

        
       

        
    }
}
